package com.bdqn.web;

import com.bdqn.pojo.News;
import com.bdqn.service.NewsService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Api页面测试控制器
 *
 * @author LILIBO
 * @since 2024-09-19
 */
@RestController
public class ApiController {

    @Resource
    private NewsService newsService;

    @PostMapping("/api/seckill")
    public News seckill(Long id) {
        return newsService.seckill(id);
    }

    @GetMapping("/api/newslist")
    public List<News> newsList() {
        return newsService.list();
    }

}
